<?php
/*
 * This is psychologist content page.
 */
include '../../include/config.php';
$mid = mysql_fetch_array(mysql_query("select mother_id from baby_child_profile_detail where bid='" . $_COOKIE['bid'] . "'")) or die(mysql_error());
$psyinfo = mysql_query("select * from baby_mother_pyco where mother_id='" . $mid[0] . "' ") or die(mysql_error());
$a = mysql_num_rows($psyinfo);
if ($a == 0) {
    $avail = false;
} else {
    $avail = true;
}
?>
<script>
    $(function(){
        $('#dlg').click(function(){$('#dialog').dialog('open');return false;});
        $('#dlg2').click(function(){$('#dlgw').dialog('open');return false;});
        $('#dlgw').dialog({autoOpen : false});
        $("#dialog").dialog({
            autoOpen : false,
            modal : true,
            width : 'auto',
            height: 'auto',
            resizable : false,                       
            buttons: {
                "Save": function() {
                    $(this).find("form").submit();
                    $(this).dialog('close'); },
                "Don't Save": function() {
                    $(this).dialog("close");
                }
            }
        });
        $( "#datepicker1,#datepicker2" ).datepicker({
            showOn: "button",
            buttonImage: "../../include/images/calendar.gif",
            buttonImageOnly: true
        });        
    });
</script>
<p>Pregnancy is often considered one of the happiest times in a woman's life; after all, you are about to welcome a beautiful new member to your family. But pregnancy isn't always such a happy time. It is often filled with stress and worry as well as numerous emotional and physical changes. As a result, many pregnant women develop depression during their pregnancies.</p>

<p>Depression can be very dangerous during pregnancy as it can compromise both your health and your baby's health. However, there are a number of effective treatments available to help you overcome pregnancy depression.</p>

<div class="demo">
    <div id="accordion" style="font-size: 12px;">
        <h3><a href="#">What is Depression?</a></h3>
        <div>
            <p>Depression is a mood disorder that causes you to feel extreme sadness. Many of us have felt a little bit blue at some point in our lives, but depression is much more intense: it causes an extreme dip in your mood that interferes with daily activities, like working, sleeping, and eating. Depression is a fairly common condition - it is thought to affect at least one in four women at some time in their live - but depression that occurs during pregnancy is of particular concern, because it can affect the health of both you and your baby.</p>
        </div>
        <h3><a href="#">How Common is Depression During Pregnancy?</a></h3>
        <div>
            <p>Depression during pregnancy is actually much more common then many people realize. At one time, health care professionals thought that pregnant women couldn't suffer from depression because of their pregnancy hormones. It was believed that these hormones protected against mood disorders like depression. </p>
            <p>It is now known that the rapid rise in hormone levels during pregnancy is actually a very common trigger for depression. At least 20% of pregnant women experience some depressive symptoms during their pregnancies, while 10% of pregnant women develop full-blown clinical depression.</p>
        </div>
        <h3><a href="#">What Causes Depression During Pregnancy?</a></h3>
        <div>
            <p>Depression is actually caused by a number of different factors. First and foremost, depression seems to be linked to a change in the levels of chemicals in the brain. These chemicals govern your moods, and when they become disrupted, this can lead to depression. </p>
            <p>During pregnancy, the rapid change in your body's hormones can trigger a change in the levels of these chemicals, resulting in depression. Depression can also be triggered by various emotional, psychological, or personal factors, including stressful life events, financial troubles, or a death in the family.</p>
        </div>

        <h3><a href="#">Who's At Risk?</a></h3>
        <div>
            <p>
                Any pregnant woman can develop depression at some point throughout her pregnancy. However, certain factors do seem to put some pregnant women at more risk for the disorder. These risk factors include:
            <ul>
                <li>personal or family history of depression</li>
                <li>relationship or personal difficulties</li>
                <li>unplanned pregnancy</li>
                <li>previous pregnancy loss</li>
                <li>pregnancy complications</li>
                <li>history of emotional, physical, or sexual abuse</li>
            </ul>
            </p>
        </div>
        <h3><a href="#">Symptoms of Depression During Pregnancy?</a></h3>
        <div>
            <p>
                The main signs of depression are unrelenting feelings of sadness, guilt, and hopelessness. This sadness persists for more than two weeks and is accompanied by some of the following symptoms:</p>
            <ul>
                <li>difficulty sleeping or oversleeping</li>
                <li>weight loss or change in appetite</li>
                <li>irritability or mood swings</li>
                <li>constant fatigue</li>
                <li>difficulty concentrating</li>
                <li>unpredictable, uncharacteristic, or bizarre behavior</li>
                <li>thoughts of self-harm or suicide</li>
                <li></li>
            </ul>
            <p>Possible Complications of Depression During Pregnancy
                Depression can be a very dangerous disorder, particularly during pregnancy. Because depression can often drain your desire and energy, pregnant women with the disorder may not seek appropriate prenatal care. Depression during pregnancy may also increase the likelihood that you will abuse alcohol, cigarettes or drugs during pregnancy. When it is most severe, depression can lead to self-harm or even suicide, causing the death of your baby. </p>
        </div>

    </div>
</div>

<fieldset>
    <legend>Personal Psychologist Info.</legend>

    <?php if ($avail == false) { ?>
        You have not inserted your Psychologist info. Enter Information :<br>
        <form action="../pre_preg/save_psy.php" method="post" >
            <table style="padding-left: 150px;" >
                <tr>
                    <td style="width: 150px;" >Dr. Name</td>
                    <td style="width: 200px;"><input type="text" name="p_doctor" /> </td>
                </tr>
                <tr>
                    <td>Address</td>
                    <td><input type="text" name="p_address" /> </td>
                </tr>
                <tr>
                    <td>City</td>
                    <td><input type="text" name="p_city" /></td>
                </tr>
                <tr>
                    <td>Country</td>
                    <td><input type="text" name="p_country"/></td>
                </tr>
                <tr>
                    <td>Telephone Nr.</td>
                    <td><input type="text" name="p_tel" /></td>
                </tr>
                <tr>
                    <td>Mobile Nr.</td>
                    <td><input type="text" name="p_mobile" /></td>
                </tr>
                <tr>
                    <td>First visit</td>
                    <td><input type="text" name="p_first_visit" id="datepicker1"  /></td>
                </tr>

                <tr>
                    <td>Last Visit</td>
                    <td><input type="text" name="p_last_visit"  id="datepicker2" /></td>
                </tr>
                <tr>
                    <td>Result</td>
                    <td><input type="text" name="p_result"  /></td>
                </tr>
                <tr>
                    <td>
                        <input type="hidden" value="<?= $mid[0] ?>" name="mid" />
                        <input type="submit" value="Save" style="float: right;" />
                    </td>
                    <td></td>
                </tr>
            </table>

        </form>  
    <?php } ?>


    <?php if ($avail == true) { ?>

        <?php if ($_GET['p'] == 'view' || $_GET['p']=='' ) { ?>
        <a href="pre-pregnancy.php?menu=psychologist&p=edit" >UPDATE</a>
            <?php while ($row1 = mysql_fetch_array($psyinfo)) { ?>                
                    <table style="padding-left: 150px;" >
                        <tr>
                            <td style="width: 150px;" >Dr. Name</td>
                            <td style="width: 200px;"><?= $row1[2] ?> </td>
                        </tr>
                        <tr>
                            <td>Address</td>
                            <td><?= $row1[3] ?></td>
                        </tr>
                        <tr>
                            <td>City</td>
                            <td><?= $row1[4] ?></td>
                        </tr>
                        <tr>
                            <td>Country</td>
                            <td><?= $row1[5] ?></td>
                        </tr>
                        <tr>
                            <td>Telephone Nr.</td>
                            <td><?= $row1[6] ?></td>
                        </tr>
                        <tr>
                            <td>Mobile Nr.</td>
                            <td><?= $row1[7] ?></td>
                        </tr>
                        <tr>
                            <td>First visit (y-m-d)</td>
                            <td><?= $row1[8] ?></td>
                        </tr>

                        <tr>
                            <td>Last Visit (y-m-d)</td>
                            <td><?= $row1[9] ?></td>
                        </tr>                        
                        <tr>
                            <td>Result</td>
                            <td><?=$row1[10]?></td>
                        </tr>
                    </table>
                
            <?php }
            ?>  
        <?php } elseif($_GET['p']=='edit') {
            ?>


            <?php while ($row1 = mysql_fetch_array($psyinfo)) { ?>
        <a href="pre-pregnancy.php?menu=psychologist" >CANCLE</a>
        <form action="../pre_preg/edit_psy.php" method="post" >
                    <table style="padding-left: 150px;" >
                        <tr>
                            <td style="width: 150px;" >Dr. Name</td>
                            <td style="width: 200px;"><input type="text" name="p_doctor" value="<?= $row1[2] ?>" </td>
                        </tr>
                        <tr>
                            <td>Address</td>
                            <td><input type="text" name="p_address" value="<?= $row1[3] ?>" </td>
                        </tr>
                        <tr>
                            <td>City</td>
                            <td><input type="text" name="p_city" value="<?= $row1[4] ?>"</td>
                        </tr>
                        <tr>
                            <td>Country</td>
                            <td><input type="text" name="p_country" value="<?= $row1[5] ?>"</td>
                        </tr>
                        <tr>
                            <td>Telephone Nr.</td>
                            <td><input type="text" name="p_tel" value="<?= $row1[6] ?>"</td>
                        </tr>
                        <tr>
                            <td>Mobile Nr.</td>
                            <td><input type="text" name="p_mobile" value="<?= $row1[7] ?>"</td>
                        </tr>
                        <tr>
                            <td>First visit</td>
                            <td><input type="text" name="p_first_visit" value="<?= $row1[8] ?>" id="datepicker1"  /></td>
                        </tr>

                        <tr>
                            <td>Last Visit</td>
                            <td><input type="text" name="p_last_visit" value="<?= $row1[9] ?>" id="datepicker2" /></td>
                        </tr>
                        <tr>
                            <td>Result</td>
                            <td><input type="text" name="p_result" value="<?= $row1[10] ?>"/></td>
                        </tr>
                        <tr>
                            <td>
                                <input type="hidden" value="<?= $mid[0] ?>" name="mid" />
                                <input type="submit" value="Edit" style="float: right;" />
                            </td>
                            <td></td>
                        </tr>
                    </table>

                </form>  
            <?php }
        }
        ?>      
    <?php } ?>    
</fieldset>
